/*
 * Copyright (c) 2013 by Gerrit Grunwald
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/******************************************************************************
 * GAUGE class                                                                *
 *****************************************************************************/
.gauge {
    -fx-skin            : "com.eru.scene.control.skin.GaugeSkin";
    -base               : BLACK;
    -background         : TRANSPARENT;
    -border-color       : WHITE;
    -needle-color       : RED;
    -min-measured-value : cornflowerblue;
    -max-measured-value : cornflowerblue;
    -threshold          : red;
    -knob-color         : #252525;
    -knob-border-color  : WHITE;
    -tick-label-fill    : WHITE;
    -histogram-fill     : rgba(  0, 200,   0, 0.3);
}


/******************************************************************************
 * GAUGE components                                                           *
 *****************************************************************************/
.gauge .background {
    -fx-background-color  : -background;
    -fx-border-color      : -border-color;
    -fx-shape             : "m 333.78571,229.96816 c -55.18314,0 -99.97774,44.77423 -99.97774,100.04495 0,55.27072 44.7946,100.01472 99.97774,100.01472 55.18314,0 99.97775,-44.744 99.97775,-100.01472 0,-55.27072 -44.79461,-100.04495 -99.97775,-100.04495 z";
}


/******************************************************************************
 * GAUGE min-measured-value                                                   *
 *****************************************************************************/
.gauge .min-measured-value {
    -fx-background-color : derive(-min-measured-value, -20%), -min-measured-value;
    -fx-background-insets: 0, 1;
    -fx-scale-shape      : true;
    -fx-shape            : "M 7.6716 5.5503 L 10.5 2.7218 L 19.2782 11.5 L 10.5 20.2782 L 7.6716 17.4497 L 13.6213 11.5 L 7.6716 5.5503 ZM 0 12 C 0 18.6275 5.3725 24 12 24 C 18.6275 24 24 18.6275 24 12 C 24 5.3725 18.6275 0 12 0 C 5.3725 0 0 5.3725 0 12 Z";
    -fx-effect           : dropshadow(two-pass-box, rgba(0, 0, 0, 0.25), 1, 0.0, 0, 1);
}


/******************************************************************************
 * GAUGE max-measured-value                                                   *
 *****************************************************************************/
.gauge .max-measured-value {
    -fx-background-color : derive(-max-measured-value, -20%), -max-measured-value;
    -fx-background-insets: 0, 1;
    -fx-scale-shape      : true;
    -fx-shape            : "M 16.2782 5.5503 L 10.3284 11.5 L 16.2782 17.4497 L 13.4497 20.2782 L 4.6716 11.5 L 13.4497 2.7218 L 16.2782 5.5503 ZM 0 12 C 0 18.6275 5.3725 24 12 24 C 18.6275 24 24 18.6275 24 12 C 24 5.3725 18.6275 0 12 0 C 5.3725 0 0 5.3725 0 12 Z";
    -fx-effect           : dropshadow(two-pass-box, rgba(0, 0, 0, 0.25), 1, 0.0, 0, 1);
}


/******************************************************************************
 * GAUGE threshold                                                            *
 *****************************************************************************/
.gauge .threshold {
    -fx-background-color : derive(-threshold, -20%), -threshold;
    -fx-background-insets: 0, 2;
    -fx-scale-shape      : true;
    -fx-shape            : "M 22.4905 22 C 23.838 22 24.3851 21.3092 23.7121 20.068 L 13.2214 0.8937 C 12.5484 -0.3492 11.453 -0.2703 10.7799 0.9724 L 0.2879 20.0269 C -0.3851 21.2681 0.1619 22 1.5093 22 L 22.4905 22 Z";
    -fx-effect           : dropshadow(two-pass-box, rgba(0, 0, 0, 0.25), 1, 0.0, 0, 1);
}


/******************************************************************************
 * GAUGE needle                                                               *
 *****************************************************************************/
.gauge .needle-standard {
    -fx-background-color : -needle-color;
    -fx-background-insets: 0, 1;
    -fx-background-radius: 0em;
    -fx-padding          : 0;
    -fx-stroke           : transparent;
    -fx-scale-shape      : true;
    -fx-shape            : "M 3.0313 0 L 0 74 L 7.9688 74 L 4.9375 0 L 3.0313 0 Z";
}
.gauge .needle-highlight {
    -fx-background-color : linear-gradient(from 0% 0% to 100% 0%,
                                           transparent 0%,
                                           transparent 50%,
                                           rgba(255, 255, 255, 0.2) 50%,
                                           rgba(255, 255, 255, 0.2) 100%);
    -fx-scale-shape      : true;
    -fx-shape            : "M 3.0313 0 L 0 74 L 7.9688 74 L 4.9375 0 L 3.0313 0 Z";
}


/******************************************************************************
 * GAUGE knob                                                                 *
 *****************************************************************************/
.gauge .knob {
    -fx-background-color : -knob-color;
    -fx-scale-shape      : true;
    -fx-border-color     : -knob-border-color;
    -fx-shape            : "M 0 100 C 0 44.7708 44.7708 0 100 0 C 155.2292 0 200 44.7708 200 100 C 200 155.2292 155.2292 200 100 200 C 44.7708 200 0 155.2292 0 100 Z";
    -fx-effect           : dropshadow(two-pass-box, rgba(0, 0, 0, 0.25), 7, 0.0, 0, 7);
}


/******************************************************************************
 * GAUGE title, unit, value, interactive-text                                 *
 *****************************************************************************/
.gauge .title {
    -fx-fill: #e5e5e5;
}

.gauge .unit {
    /*-fx-fill: ladder(-base, #888888 49%, white 50%);*/
    -fx-fill: #e5e5e5;
}

.gauge .value {
    /*-fx-fill: ladder(-base, derive(#444444, -20%) 49%, #444444 50%);*/
    -fx-fill: #e5e5e5;
}
